package com.jettech.oa.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

@Entity
@Table(name="jettech_form_property")
public class FormProperty implements Serializable {
	private static final long serialVersionUID = -5462635111874176211L;
	private Long id;
	private WorkFlowForm workFlowForm;
	private String value;
	
	public FormProperty(){
		
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="form_property_id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="work_flow_form_id")
	public WorkFlowForm getWorkFlowForm() {
		return workFlowForm;
	}
	public void setWorkFlowForm(WorkFlowForm workFlowForm) {
		this.workFlowForm = workFlowForm;
	}
	@Column(name="form_property_value")
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}

	public boolean equals(Object other){
		return EqualsBuilder.reflectionEquals(this, other);
	}
	public int hashCode(){
		return HashCodeBuilder.reflectionHashCode(this);
	}
	public String toString(){
		return ToStringBuilder.reflectionToString(this);
	}
}
